﻿

/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年1月8日 21:18:21
//类描述：业务逻辑层 BdOperateLog 
//最后修改者:郑雪松
//最后修改时间: 2013年1月8日 21:18:21
=========================================================================================*/
using System;
using System.Runtime.Serialization;
using System.Collections.Generic;
using COM.Rights.Model;
//using COM.Rights.IDAL;
//using COM.Rights.DAL;

namespace COM.Rights.BLL
{
    /// <summary>
    /// 业务逻辑层 BdOperateLog 
    /// </summary>  
    public partial class BdOperateLog : BaseBLL<BdOperateLogInfo>
    {
        IBaseDAL<BdOperateLogInfo> dal;
        public BdOperateLog() : base(DBType.Sql2005) { dal = base.Instance; OnBLLCreated(); }
        partial void OnBLLCreated();

        //记录操作日志
        public void OperateLog(string OperateBy, string IDS, string TableName, string OperateType)
        {
            List<DBParameter> _listDBParameter = new List<DBParameter>();
            _listDBParameter.Add(new DBParameter("@TranType", "Save"));
            _listDBParameter.Add(new DBParameter("@OperateBy", OperateBy));
            _listDBParameter.Add(new DBParameter("@IDS", IDS));
            _listDBParameter.Add(new DBParameter("@TableName", TableName));
            _listDBParameter.Add(new DBParameter("@OperateType", OperateType));
            ExecuteNonQuery("[dbo].[bdOperateLog_Save]", _listDBParameter, System.Data.CommandType.StoredProcedure);

        }

        //恢复删除的日志
        public void RecoverLog(string IDS)
        {
            List<DBParameter> _listDBParameter = new List<DBParameter>();
            _listDBParameter.Add(new DBParameter("@TranType", "RecoverLog"));
            _listDBParameter.Add(new DBParameter("@IDS", IDS));
            ExecuteNonQuery("[dbo].[bdOperateLog_Save]", _listDBParameter, System.Data.CommandType.StoredProcedure);

        }

        //恢复删除的日志
        public void Delete(string IDS)
        {
            List<DBParameter> _listDBParameter = new List<DBParameter>();
            _listDBParameter.Add(new DBParameter("@TranType", "Delete"));
            _listDBParameter.Add(new DBParameter("@IDS", IDS));
            ExecuteNonQuery("[dbo].[bdOperateLog_Save]", _listDBParameter, System.Data.CommandType.StoredProcedure);

        }
    }
}